<html>
    <head>
        <title>Leaflet TimeDimension</title>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.5.1/dist/leaflet.css">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/1.4.2/Control.FullScreen.min.css">
        <link rel="stylesheet" href="../src/leaflet.timedimension.control.css" />
        <link rel="stylesheet" href="css/style.css" />
    </head>
    <body>
        <div class="container">
            <div id="header">
                <h1>Leaflet TimeDimension example 16</h1>
                <h2><a href="https://portus.puertos.es/Portus_RT/?locale=es">Portus</a> Wave forecast</h2>
            </div>
            <div id="map" class="map"></div>

            <h2>Information</h2>
            <div class="information">
            <p>This example use an extra Leaflet.TimeDimension class: <a href="js/extras/leaflet.timedimension.tilelayer.portus.js">L.TimeDimension.Layer.TileLayer.Portus</a>.</p>

            <p>Portus wave forecast is served as different TileLayers with datetime as a part of the URL (in the format yyyymmddhh). The class is constructing a new TileLayer taking the URL of the base layer as a template (note the {d} and {t} placeholder).</p>
            </div>

            <h2>Code</h2>
            <pre><code class="javascript" id="code"></code></pre>
            <h2>Code of L.TimeDimension.Layer.TileLayer.Portus</h2>
            <pre><code class="javascript" id="code-portus"></code></pre>

            <div class="prev-example">
                <a href="example16.html">Example 15: Oil Spill simulation</a>
            </div>
            <div class="next-example">
                <a href="example17.html">Example 17: Basic GeoJSON usage</a>
            </div>
            <div id="footer">
                <a class="leaflet-timedimension" href="index.html">Leaflet.TimeDimension examples</a>
                <a class="github" href="https://github.com/socib/Leaflet.TimeDimension" title="Fork Leaflet.TimeDimension at GitHub!"><span>Fork Leaflet.TimeDimension at GitHub</span></a>
            </div>
        </div>

        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/leaflet@1.5.1/dist/leaflet.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/1.4.2/Control.FullScreen.min.js"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/leaflet.nontiledlayer@1.0.7/dist/NonTiledLayer.js"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/iso8601-js-period@0.2.1/iso8601.min.js"></script>

        <script type="text/javascript" src="../src/leaflet.timedimension.js"></script>
        <script type="text/javascript" src="../src/leaflet.timedimension.util.js"></script>
        <script type="text/javascript" src="../src/leaflet.timedimension.layer.js"></script>
        <script type="text/javascript" src="../src/leaflet.timedimension.layer.wms.js"></script>
        <script type="text/javascript" src="../src/leaflet.timedimension.layer.geojson.js"></script>
        <script type="text/javascript" src="../src/leaflet.timedimension.player.js"></script>
        <script type="text/javascript" src="../src/leaflet.timedimension.control.js"></script>
        <script type="text/javascript" src="js/extras/leaflet.timedimension.tilelayer.portus.js"></script>
        <script type="text/javascript" src="js/baselayers.js"></script>
        <script type="text/javascript" src="js/example16.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
        <script type="text/javascript">
            var oReq = new XMLHttpRequest();
            oReq.addEventListener("load", (function(xhr) {
                var code = xhr.currentTarget.response;
                var codeBlock = document.getElementById("code");
                codeBlock.textContent = code;
                hljs.highlightBlock(codeBlock);
            }));
            oReq.open("GET", "js/example16.js");
            oReq.send();
            var oReq = new XMLHttpRequest();
            oReq.addEventListener("load", (function(xhr) {
                var code = xhr.currentTarget.response;
                var codeBlock = document.getElementById("code-portus");
                codeBlock.textContent = code;
                hljs.highlightBlock(codeBlock);
            }));
            oReq.open("GET", "js/extras/leaflet.timedimension.tilelayer.portus.js");
            oReq.send();
        </script>
    </body>
</html>
